package org.example.controller.admin;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.example.dto.ShanjiaZhxg;
import org.example.result.Result;
import org.example.service.KaidianService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/admin/kaidian")
@Slf4j
@Api(tags = "开店相关接口")
public class EmployeekaidianController {

    @Autowired
    KaidianService kaidianService;
    /**
     * 新增开店
     * @return
     */
    @PostMapping("/xz")
    @ApiOperation(value = "新增开店")
    public Result xz(@RequestParam( "yonghu") String yonghu,
                     @RequestParam( "dianpu") String dianpu) {
        kaidianService.xz(yonghu,dianpu);
        return Result.success();
    }

    /**
     * 查询
     * @return
     */
    @GetMapping("/cx")
    @ApiOperation(value = "查询")
    public Result<ShanjiaZhxg> cx(@RequestParam( "username") String yonghu) {

        return Result.success( kaidianService.cx(yonghu));
    }



}
